#pragma once

#include "BinaryWriter.h"
#include "BinExportTypes.h"
class VertexList;
class TriangleList;


/**
* Writes a meshlist to a binary file.
* @author Koen Samyn
*/
class BinObjWriter:public BinaryWriter
{
public:
	/**
	* Creates an empty BinObjWriter object.
	*/
	BinObjWriter(){};
	/**
	* Creates a new BinObjWriter object.
	* @param meshList the mesh list to write.
	* @param file the destination file.
	*/
	BinObjWriter(tstring file);
	/**
	* Destroys the BinObjWriter object.
	*/
	virtual ~BinObjWriter(void);
	/**
	* Writes the location of the material file.
	* @param materialFile the location of the material file.
	* @return true if the location could be written, false otherwise.
	*/
	bool WriteMaterialFile(tstring& materialFile);
	/**
	* Writes the location of the skeleton file.
	* @param skeletonFile the location of the skeleton file.
	* @return true if the skeleton file could be written, false otherwise.
	*/
	bool BinObjWriter::WriteSkeletonFile(tstring& skeletonFile);
	/**
	* Writes a VertexList to the output stream.
	* @param vertexList the vertexList to the write to the stream.
	* @return true if writing the file was succesful , false otherwise.
	*/
	bool WriteVertexList(VertexList* vertexList);
	/**
	* Writes a VertexList to the output stream.
	* @param vertexList the vertexList to the write to the stream.
	* @param skeletonFile the location of the skeleton file.
	* @return true if writing the file was succesful , false otherwise.
	*/
	bool WriteVertexList(VertexList* vertexList, tstring& skeletonFile);
	/**
	* Write the index buffers.
	* @param triangleList the triangleList to write.
	* @param materialFile the material to use for this triangle list.
	*/
	bool WriteTriangleList(TriangleList* triangleList,tstring& materialFile);
private:
	/**
	* Writes the part of the vertex list that should always be written.
	* @param vertexList the VertexList to write.
	*/
	void WriteCommonVertexList(VertexList* vertexList);
	// -------------------------
	// Disabling default copy constructor and default assignment operator.
	// If you get a linker error from one of these functions, your class is internally trying to use them. This is
	// an error in your class, these declarations are deliberately made without implementation because they should never be used.
	// -------------------------
	BinObjWriter(const BinObjWriter& t);
	BinObjWriter& operator=(const BinObjWriter& t);
};
